


import 'package:flutter/material.dart';
import 'package:flutter_my_web/pages/tools/server/server_utils/PeerBean.dart';
import 'package:flutter_my_web/widget/TextWidget.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class ServerPageItem extends StatefulWidget {
  PeerBean bean;
  Function? call;
  Function? closeCall;
  Function? sendFile;
  Function? message;

  ServerPageItem(this.bean, {this.call, this.closeCall, this.message,this.sendFile});

  @override
  State<ServerPageItem> createState() => _ServerPageItemState();
}

class _ServerPageItemState extends State<ServerPageItem> {
  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.all(10.w),
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.center,
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Expanded(child: SimpleText(widget.bean.isShelf?"自身":"ID:${widget.bean.id}",fontSize: 13.sp,)),
          InkWell(onTap:(){
            widget.call?.call();
          },child: Icon(Icons.call,size: 30,color: widget.bean.isCall?Colors.blue:Colors.black,)),
          SizedBox(width: 20.w,),
          InkWell(onTap:(){
            widget.closeCall?.call();
          },child: Icon(Icons.call_end,size: 30,)),
          SizedBox(width: 20.w,),
          InkWell(onTap:(){
            widget.message?.call();
          },child: Icon(Icons.message,size: 30,)),
          SizedBox(width: 20.w,),
          InkWell(onTap:(){
            widget.sendFile?.call();
          },child: Icon(Icons.send_time_extension,size: 30,)),
        ],
      ),
    );
  }
}
